package chapter1;

/**
 * @author ycj
 * @version 1.0
 * @description: TODO
 * @date 2022/5/16
 */
public class Source1_3 {
    public static void main(String[] args) {
        //创建线程
        Welcome2 welcome2 = new Welcome2();
        Thread thread = new Thread(welcome2);

        //启动线程
        thread.start();
        System.out.println("欢迎我是线程="+Thread.currentThread().getName());

        //欢迎我是线程=main
        //欢迎我是线程=Thread-0
    }
}


class Welcome2 implements Runnable {
    @Override
    public void run() {
        System.out.println("欢迎我是线程="+Thread.currentThread().getName());
    }
}